<template>
	<div id="actives">
		<div class="fixed">
			<div class="title flex">
				<div class="title_left">
					<img @click="back" src="../assets/image/return.png" />
				</div>
				<div class="add">
					查看报名
				</div>
				<div class="title_right">
					<!--<img src="../assets/image/shar.png" />-->
				</div>
			</div>

		</div>
		<div class="lists">

			<div class="list flex"  >

				<div class="qian" v-if="tableData.sort.coupons_type==1">
					<div>{{tableData.sort.coupons_money}}</div>
					<img style="width: 0.4217rem;height: 0.5217rem;" src="../assets/image/qian.png" />
				
				</div>
				<div class="qian" v-if="tableData.sort.coupons_type==2">
				<div>{{tableData.sort.coupons_discount}}</div>
					
				
				
					<img style="width: 0.565217rem;height: 0.8043rem;" src="../assets/image/zhe.png"/>
				</div>
				<div class="xian">
					<img src="../assets/image/fengexain.png" />
				</div>
				<div class="right flex">
					<div v-if="tableData.sort.coupons_type==1">满{{tableData.sort.full_money}}享满减</div>
					<div v-if="tableData.sort.coupons_type==2">满{{tableData.sort.full_money}}享折扣</div>
					
					<div class="data">
						<span>有效期：</span><span>{{active_start_time}}至{{active_end_time}}</span>
					</div>
				</div>

			</div>
			
			<div class="detail">
			   <p>使用说明</p>
			   <div class="shiyong_detail">
			   	{{tableData.sort.use_desc}}
			   </div>
			   <div class="con">
			   	<div class="shopname">
			   	店铺：<span>{{store.store_name}}</span>
			   </div>
			    <div class="phone">
			   	联系电话：<span style="color: #007AFF;">{{store.store_phone}}</span>
			   </div>
			    <div class="address">
			   地址：<span>{{store.store_address}}</span><img src="../assets/image/dingwei.png"/>
			   </div>
			   </div>
			   
			</div>

		</div>
		<div class="btn flex">
	<div @click="pass()">
		通过
	</div>
	<div @click="showtost()">
		拒绝
	</div>
</div>
<!--拒绝理由的弹窗-->
		<div class="mask">
			<div class="tip flex">
				<div class="tip_title flex">
					<div>

					</div>
					<div>
					请填写拒绝理由
					</div>
					<img @click="yincang" src="../assets/image/chahao.png" />

				</div>

               <div class="center">
               	<textarea name="" rows="" cols="" v-model="liyou"></textarea>
               </div>
				<div class="tip_btn flex">
					<div class="queding" @click="res()">
						确定
					</div>
					<div class="quxiao" @click="yincang">取消</div>
				</div>

			</div>
		</div>


	</div>



</template>

<script>
	export default {
		data() {
			return {
				isActive: 0,
				show: -1,
				activeIndex: -1,
               link_id:this.$route.query.link_id,
               	active_start_time:"",
               	active_end_time: "",
               	liyou:"",
               	store:[{
               		store_address:"",
               		store_name:"",
               		store_phone:""
               	}],
               tableData:[{
               	sort:{
               		coupons_money:"",
               		coupons_discount:"",
               		coupons_type:"",
               		full_money:"",
               		use_desc:""
               	},
               	
               }],
			}
		},
		//在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图
		created: function() {
           this.list()
		},
		methods: {
			back() {
				this.$router.go(-1)
			},
			showop(index) {
				let that = this;
				if(that.show == index) {
					that.show = -1; //在这里就将它赋值为-1  由于：-1 !=  index 所以其他内容隐藏 ，被点击的则打开
				} else {
					that.show = index; //这里是把index赋值给isShow，isShow=index则显示
				}

			},
			//查看详情
			creat_c() {
				this.$router.push({
					path: '/Create_coupons'
				});
			},
			showtost() {
				$(".mask").css('display', 'block');

			},
			yincang() {
				$(".mask").css('display', 'none');
			},
			  list(){
           	var that=this;
           var qs = require('qs');
			that.$http.post(this.baseURL+"/index.php/waveguest/coupon/enroll_verify_status", qs.stringify({
						"link_id": that.link_id,
						"key":localStorage.getItem("key")
				})).then(response => {
					
					that.tableData=response.data.data
					console.log(response.data.data)
					that.active_start_time=response.data.data.time.active_start_time
               	that.active_end_time=response.data.data.time.active_end_time
               	that.store=response.data.data.store
					})
					.catch(error => {

					});
    
          },
           pass(){
           	var that=this;
      var qs = require('qs');
			that.$http.post(this.baseURL+"/index.php/waveguest/coupon/enroll_verify_pop", qs.stringify({
						"id":localStorage.getItem("store_id"),
						"link_id":that.link_id,
						"link_activeid":that.tableData.link_activeid,
						"link_storeid":that.tableData.link_storeid,
						"link_to_status":1,
						"key":localStorage.getItem("key")
						
				})).then(response => {
					
					if(response.data.data.code==1){
						 this.$message.success('审核成功');
						  this.$router.go(-1)
					}else {
						 this.$message.error(response.data.message);
					}
					})
					.catch(error => {

					});
    
           },
          
           res(){
           	var that=this;
      var qs = require('qs');
			that.$http.post(this.baseURL+"/index.php/waveguest/coupon/enroll_exit", qs.stringify({
						"link_id":that.link_id,
						"exit_desc":that.liyou,
						"key":localStorage.getItem("key")
						
				})).then(response => {
					
					if(response.data.data.code==1){
						 this.$message.success('已拒绝');
						 this.$router.go(-1)
					}else {
						 this.$message.error(response.data.message);
					}
					})
					.catch(error => {

					});
    
           }
		},
		mounted() {
 

		},
	}
</script>

<style>
.el-message {
    min-width: 4rem;
    top: 40% !important;
}
</style>
<style scoped="scoped">
	#actives {
		background: #F5F6FA;
		height: 100%;
		width: 100%;
		position: fixed;
		
	}
		
	.title {
		width: 90%;
		padding: 0 5% 0 5%;
		height: 2rem;
		font-size: 0.7193rem;
		background: white;
		align-items: center;
	}
	
	.title div {
		width: calc(100%/3);
		align-items: center;
	}
	
	.title>div:nth-child(2) {
		text-align: center;
	}
	
	
	
	.title_left {
		width: 0.67391rem;
		height: 0.67391rem;
	}
	
	.title_left>img {
		width: 0.67391rem;
		height: 0.67391rem;
	}
	
	.title_right {
		width: 0.9rem;
		height: 0.9rem;
	}
	
	.title_right>img {
		width: 0.9565rem;
		height: 0.9365rem;
		float: right;
	}
	
	.lists {
		margin-top: 2rem;
		padding-top: 1rem;
		
	}
	
	.list {
		/*border: 1px solid white;*/
		margin-bottom: 0.5rem;
		margin-left: 0.5rem;
		margin-right: 0.5rem;
		padding-right: 1rem;
		padding-left: 1rem;
		background: url(../assets/image/quan_bg.png) no-repeat;
		background-size: 100%;
		border-radius: 10px;
		height: 5.8478rem;
		justify-content: space-between;
		align-items: center;
		
	}
	.fixed {
		position: fixed;
		top: 0;
		background: white;
		width: 100%;
		max-width: 640px;
		
	}
   .list>.qian{
   	font-size: 2.57826rem;
   	color: white;
   	position: relative;
   }
    .list>.qian>img{
   	
   	position: absolute;
   	right: -0.5rem;
   	top: 0;
   }
   .list>.right{
   	font-size: 1.3043rem;
   	color: white;
   flex-direction: column;
   }
   .list>.xian>img{
   width: 0.07rem;
   height: 1.7391rem;	
   }
   .list>.right>.data{
   	padding-top: 0.5rem;
   	font-size: 0.5rem;
   	color: white;
  
   }
.detail{
	background: white;
	margin-bottom: 0.5rem;
		margin-left: 0.5rem;
		margin-right: 0.5rem;
		padding: 1rem;
		border-radius: 10px;
		font-size: 0.60869rem;
		font-weight: 600;
}
	.shiyong_detail{
		font-size: 0.5652rem;
		color: #868E91;
		font-weight: 400;
		padding-top: 0.3rem;
	}
	.con{
		margin-top: 1.1rem;
		padding-bottom: 1rem;
	}
	
	.con>div{
		padding-bottom: 0.3rem;
	}
	.con span{
		color: #868E91;
		font-weight: 400;
	}
	.con>div>img{
	 width: 0.7608rem;
	 height: 0.7608rem;
	 padding-left: 0.3rem;
	}
	.btn{
		width: 100%;
		justify-content: space-around;
	}
	.btn>div{
		width: 6.4347rem;
		height: 1.8478rem;
		border: 1px solid;
		border-radius: 10px;
		text-align: center;
		line-height: 1.8478rem;
		color: white;
		font-size: 0.65217rem;
		margin-top: 3rem;
	}
	.btn>div:nth-child(1){
		background: white;
		border: 1px solid #007AFF;
		color: #007AFF;
	}
	.btn>div:nth-child(2){
		background: #007AFF;
		border: 1px solid #007AFF ;
		color: white;
	}
	
	
.mask{
		position: fixed;
		width: 100%;
		left: 0;
		top: 0;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.4);
		transition: all 0.2s ease-in;
		z-index: 99;
		display: none;

	}

	.mask .center textarea {
		width: 80%;
		margin-left: 10%;
		margin-top: -0.5rem;
		font-size: 0.8rem;
		height: 3rem;
	}

	
	.mask .tip_btn {
		width: 100%;
		height: 1.9043rem;
		justify-content: center;
		align-items: center;
		margin-top: 1rem;
		margin-bottom: 0.5rem;
	}

	
	.mask_chexiao_tip .tip_btn>div {
		width: 6.3913rem;
		height: 1.3043rem;
		background: #007AFF;
		border-radius: 0.47826rem;
		color: white;
		font-size: 0.60869rem;
		text-align: center;
		line-height: 1.3043rem;
		
	}

	.tip {

		width: 13.78260rem;
		margin: 50vh auto;
		transform: translateY(-50%);
		background: white;
		border-radius: 0.5rem;
		flex-direction: column;
	}

	.tip_title {
		width: 90%;
		padding: 5%;
		font-size: 0.7826rem;
		justify-content: space-between;
		line-height: 2rem;
	}

	.tip_title img {
		width: 0.565212rem;
		height: 0.565212rem;


	}

	.center div {
		width: 60%;
		margin-left: 20%;
		color: #3E474E;
		font-size: 0.565217rem;

	}

	.tip_btn {
		font-size: 0.6087rem;
		justify-content: space-between;
		align-items: center;
	}

	.queding,
	.quxiao {
		width: 4.9782rem;
		height: 1.3043rem;
		text-align: center;
		margin-top: 1rem;
		margin-bottom: 0.5rem;

		color: #868E91;
		line-height: 1.3043rem;
		align-items: center;

	}

	.quxiao {
		color: white;
		background: #007AFF;
		border-radius: 10px;
		margin-right: 1rem;
	}

	.queding {
		margin-left: 1rem;
	}

	.right_foot {

		align-items: center;
		margin-top: 1rem;
	}

	.right_foot>img {
		width: 0.47826rem;
		height: 0.47826rem;
		padding-left: 0.2rem;
	}

	.right_foot>span {
		font-size: 0.565217rem;
	}
</style>